<template>
  <div id="app">
    <router-view class="main"></router-view>
    <van-tabbar route v-show="isShowNav">
      <van-tabbar-item icon="home-o" :to="{ name: 'Home' }"
        >首页</van-tabbar-item
      >
      <van-tabbar-item
        class="search"
        icon="search"
        :to="{ name: 'Music' }"
      ></van-tabbar-item>
      <van-tabbar-item icon="setting-o" :to="{ name: 'User' }"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data() {
    return {
      //控制底部导航栏显示与隐藏
      isShowNav: true,
    };
  },
  watch: {
    //当前路由
    $route(v) {
      if (v.meta.hideNav) {
        this.isShowNav = false;
      } else {
        this.isShowNav = true;
      }
    },
  },
};
</script>

<style>
* {
  box-sizing: border-box;
}
</style>
